#include "../../API/linkedList/linkedListAPI.h"
#include "stdio.h"

typedef struct tester{
  int arg1;
  int arg2;
}TESTER;

void clearTesterStructure(void * data)
{
  TESTER *testerData = (TESTER*)data;

  printf("Tester Arg1: %d, Tester Arg2: %d\n", testerData->arg1, testerData->arg2);

  /* need to check for a memory leak here, not experienced enough */
  free(testerData);

}

int main(int argc, char **argv)
{
  List *pList1 = NULL;
  TESTER dataBuilder;

  dataBuilder.arg1 = 10;
  dataBuilder.arg2 = 15;

  //printf("size of buffer %d\n\n", (int)sizeof(dataBuilder));

  linkedListInsert(&pList1, &dataBuilder, sizeof(dataBuilder));
  printf("Sized 1\n");
  linkedListInsert(&pList1, &dataBuilder, sizeof(dataBuilder));
  printf("Sized 2\n");
  linkedListInsert(&pList1, &dataBuilder, sizeof(dataBuilder));
  printf("Sized 3\n");
  linkedListRemoveFirst(&pList1, clearTesterStructure);
  printf("Removed 1\n");
  linkedListRemoveFirst(&pList1, clearTesterStructure);
  printf("Removed 2\n");
  linkedListRemoveFirst(&pList1, clearTesterStructure);
  printf("Removed 3\n");

  if(pList1 == NULL) printf("Linked List Released from Memory\n");

  return 1;
}
